import { observable } from "mobx"
import Taro from "@tarojs/taro"
import { fetchCnode } from "../../api/cnode"

export default observable({
  list: [],
  getList(params) {
    fetchCnode(params).then(res => {
      // this.list = res;
      this.list = [...this.list, ...res]
      console.log("list:", this.list);
      if (params.page == 1) {
        Taro.stopPullDownRefresh();
      }
    })
  },
  resetList() {
    this.list = []
  }
})